1. Technical Field of the Invention
The present invention relates to processors and more particularly to processors that execute Java™ bytecodes.
2. Background Information
Java™ is a programming language that, at the source code level, is similar to object oriented programming languages such as C++. Java™ language source code is compiled into an intermediate representation based on a plurality of “bytecodes” that define specific tasks. In some implementations, the bytecodes are further compiled to machine language for a particular processor. Some processors, however, are designed to execute some of the Java™ bytecodes directly.
An “opcode” is a single member of the group bytecodes, and one such opcode is known as “WIDE,” having a value 0xC4 (hexadecimal value C4). In particular, when an opcode is immediately preceded by a WIDE opcode, the operand width is greater than if the WIDE opcode is not present. For example, a directly executed Java™ opcode “ILOAD” (integer load), when not preceded by WIDE, may fetch a 32 bit word into the local variable at the location indicated by an eight bit operand. When ILOAD is immediately preceded by a WIDE opcode, the ILOAD opcode may fetch a 32 bit word into the local variable at the location indicated by a sixteen bit operand. Thus, WIDE extends the number of available local variables to 65,536, though each local variable is 32 bits in width regardless of the presence or absence of a WIDE. When decoding and executing opcodes, the processor decodes the WIDE but does not execute a “WIDE” function; rather, the processor adjusts the operand width of a subsequent opcode based on the presence of the WIDE.
Opcodes are each 8 bits in width, limiting the set of bytecodes to 256 possible opcodes. Thus, the WIDE opcode utilized as a prefix limits by one the functions that can be assigned specific opcodes.